/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * tipDialog.java
 *
 * Created on 2011-6-5, 9:24:53
 */
package publicmethod;

import com.sun.awt.AWTUtilities;
import publicmethod.*;
import java.util.Vector;
import javax.swing.*;
import java.awt.event.MouseListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.StringTokenizer;
import junchangmis.codecSetting.codecMethodNew;

/**
 *
 * @author developers
 */
public class tipDialog extends javax.swing.JDialog {

    DefaultListModel codeListModel = new DefaultListModel();
    Vector<String> classCodes;

    /** Creates new form tipDialog */
    public tipDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);

        initComponents();
        AWTUtilities.setWindowOpaque(this, false);
        this.jListClassCode.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    }

    public tipDialog(java.awt.Dialog parent, boolean modal) {
        super(parent, modal);
        initComponents();
        AWTUtilities.setWindowOpaque(this, false);
        this.jListClassCode.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    }

    public void getItem(Vector<String> classCodes) {
        this.classCodes = classCodes;
        updateList();
    }

    private void updateList() {
        this.codeListModel.removeAllElements();
        if (classCodes != null) {
            for (int i = 0; i < classCodes.size(); i++) {

                this.codeListModel.addElement(classCodes.get(i));
                this.jListClassCode.updateUI();
            }
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jListClassCode = new javax.swing.JList();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setUndecorated(true);

        jListClassCode.setFont(new java.awt.Font("仿宋", 0, 18)); // NOI18N
        jListClassCode.setModel(codeListModel);
        jScrollPane1.setViewportView(jListClassCode);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*   java.awt.EventQueue.invokeLater(new Runnable() {
        
        public void run() {
        tipDialog dialog = new tipDialog(new javax.swing.JFrame(), true);
        dialog.addWindowListener(new java.awt.event.WindowAdapter() {
        
        public void windowClosing(java.awt.event.WindowEvent e) {
        System.exit(0);
        }
        });
        dialog.setVisible(true);
        }
        });*/
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JList jListClassCode;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
